home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / Interfaces&Libraries / Interfaces / CIncludes / stdexcept.h < prev    next >
Encoding:
Text File  |  1997-01-17  |  1.8 KB  |  80 lines  |  [TEXT/MPS ]

  1. //
  2. //    <stdexcept> header
  3. //        This header is defined as in clause 19 of the
  4. //        current (January 1996) C++ working papers.
  5. //        However, the C++ library shipped with this version
  6. //        of MrCpp does *not* throw any of these exceptions.
  7. //        This file is present as a placeholder and so that
  8. //        users may start using the standard exceptions
  9. //        hierarchy.
  10. //
  11. //        Copyright 1996, Apple Computer, Inc.
  12. //
  13.  
  14. #ifndef __STDEXCEPT_H
  15. #define __STDEXCEPT_H 1
  16.  
  17.  
  18. #include <exception.h>
  19. /* We do not yet have a std <string> header... */
  20. class string;
  21.  
  22. //
  23. // Once <exception> is in place, this place-holder
  24. // definition of "class exception" will be removed.
  25. //
  26. class exception {
  27.  public:
  28.       exception() throw() {}
  29.       exception(const exception&) throw() {}
  30.       exception& operator=(const exception&) throw() {}
  31.       virtual ~exception() throw() {}
  32.       virtual const char* what() const throw() {}
  33. };
  34.  
  35. //  namespace std {
  36.  
  37.     class logic_error : public exception {
  38.     public:
  39.       logic_error(const string& what_arg);
  40.     };
  41.  
  42.     class domain_error : public logic_error {
  43.     public:
  44.       domain_error(const string& what_arg);
  45.     };
  46.  
  47.     class invalid_argument : public logic_error {
  48.     public:
  49.       invalid_argument(const string& what_arg);
  50.     };
  51.  
  52.     class length_error : public logic_error {
  53.     public:
  54.       length_error(const string& what_arg);
  55.     };
  56.  
  57.     class out_of_range : public logic_error {
  58.     public:
  59.       out_of_range(const string& what_arg);
  60.     };
  61.  
  62.     class runtime_error : public exception {
  63.     public:
  64.       runtime_error(const string& what_arg);
  65.     };
  66.  
  67.     class range_error : public runtime_error {
  68.     public:
  69.       range_error(const string& what_arg);
  70.     };
  71.  
  72.     class overflow_error : public runtime_error {
  73.     public:
  74.       overflow_error(const string& what_arg);
  75.     };
  76.  
  77. // }
  78.  
  79. #endif // __STDEXCEPT_H
  80.